<script setup lang="ts">
import {ref, watch, onMounted} from "vue";
import {RoomGroupVo, RoomService, UserQueryCriteria, UserService, UserVo} from "/@/api/openapi";
import {ElMessage} from "element-plus";
import {useUserFriendStore, useUserStore} from "/@/store";
import {storeToRefs} from "pinia";

const tableRef = ref()
const tableData = ref<RoomGroupVo[]>();
const total = ref(0);
const userFriendStore = useUserFriendStore();
const {chatGroup} = storeToRefs(userFriendStore);
// 这里获取群组消息
const loadData = async () => {
    userFriendStore.updateChatGroup()
}
const store = useUserStore();
onMounted(()=>{
    if(store.isSign){
        loadData();
    }
})

</script>

<template>
    <div>
        <el-button @click="loadData" class="flesh">刷新</el-button>
        <el-table :ref="tableRef" :data="chatGroup" style="width: 100%">
            <el-table-column prop="name" label="用户名称" width="180"/>
            <el-table-column prop="avatar" label="签名" width="180"/>
        </el-table>
    </div>
</template>

<style scoped>

</style>